package com.rw.coco.model;

import com.rw.coco.util.CocoReplyUtil;
import com.rw.tool.util.properties.PropertiesReader;
import com.rw.tool.util.string.StringFormatter;

/**
 * 可可回复专用读取器
 */
public class CocoPropertiesReader extends PropertiesReader {
    public CocoPropertiesReader(String path) {
        super(path);
    }

    @Override
    public String get(String key) {
        // 获取原始回复和机器人名称
        String reply = super.get(key);
        String botName = super.get(CocoReplyUtil.BOT_NAME);

        return StringFormatter.replaceAll(reply, botName);
    }
}
